package com.xingkeduo.business.order.remote.feign;

import com.xingkeduo.dto.BatchLockStockParam;
import com.xingkeduo.dto.StockForOrderVo;
import com.xingkeduo.dto.StockParam;
import com.xingkeduo.utils.ResponseMessage;
import com.xingkeduo.utils.ResponseUtils;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "business-workpad", fallback = WordPadFeignServiceImpl.class)
public interface WordPadFeignService {

    /**
     * 锁定库存
     * @param stockId
     * @param orderNo
     * @param status
     * @return
     */
    @RequestMapping("/staff/stock/lockStockBystockId")
    ResponseUtils lockStockBystockId(@RequestParam(value = "stockId") Long stockId, @RequestParam(value = "orderNo") String orderNo
            , @RequestParam(value = "status") byte status, @RequestParam(value = "lineNo") String lineNo
            , @RequestParam(value = "userPath") String userPath,@RequestParam(value = "storeId") Long storeId);

    /**
     * 库存解锁
     * @param
     * @return
     */
    @RequestMapping("/staff/stock/unlockStockBystockId")
    ResponseUtils unlockStockBystockId(@RequestParam(value = "orderNo") String orderNo,@RequestParam(value = "storeId") Long storeId);


    /**
     * 根据店铺Id 发型师Id 订单号 库存状态 排队号 锁定最早可约库存
     * @return
     */
    @PostMapping("/staff/stock/lockMinFreeStock")
    ResponseUtils<StockForOrderVo> lockMinFreeStock(@RequestBody StockParam stockParam);


    /**
     * 锁定库存   barber
     * @param
     * @return
     */
    @PostMapping("/staff/stock/batchLockStockBystockId")
    ResponseUtils batchLockStockBystockId(@RequestBody List<BatchLockStockParam> batchLockStockParams);


    /**
     * 解锁库存   barber
     * @param
     * @return
     */
    @PostMapping("/staff/stock/batchUnlockStockBystockId")
    ResponseUtils batchUnlockStockBystockId(@RequestBody List<BatchLockStockParam> batchLockStockParams);


    /**
     * 获得库存状态
     * @param storeId
     * @param orderNo
     * @return
     */
    @GetMapping("/staff/stock/getStockIsEnable")
    ResponseUtils<Boolean> getStockIsEnable(@RequestParam(value = "storeId") Long storeId,@RequestParam(value = "orderNo") String orderNo);


    /**
     * 单库存改约
     * @param storeId
     * @param orderNo
     * @return
     */
    @GetMapping("/staff/stock/changeStockBystockIdAndorderNo")
    ResponseUtils changeStockBystockIdAndorderNo(
                                                    @RequestParam(value = "stockId") Long stockId,
                                                    @RequestParam(value = "orderNo") String orderNo,
                                                    @RequestParam(value = "status") byte status,
                                                    @RequestParam(value = "storeId") Long storeId,
                                                    @RequestParam(value = "lineNo") String lineNo
    );



}
